package com.netease.pris.protocol;

import android.os.Build.VERSION;
import android.text.TextUtils;
import com.netease.framework.a.k;
import com.netease.framework.a.m;
import com.netease.pris.a.e;
import com.netease.pris.atom.ac;
import com.netease.pris.atom.s;
import com.netease.pris.atom.userinfo.UserInfo;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.message.BasicNameValuePair;

public class c
{
  static final boolean a;
  public static String b = "anonymous";
  public static String c = "anonymous";
  public static String d = "android_pris_login_seesion_id";

  public static k a(com.netease.pris.atom.u paramu, ac paramac, String paramString1, String paramString2)
  {
    String str = paramu.bg();
    if (str == null)
      str = com.netease.pris.b.a.B();
    k localk = new k(str, com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.a(paramu.V(), paramu.U(), paramu.bd(), paramu.bf(), paramac, paramString1)));
    return localk;
  }

  public static k a(com.netease.pris.atom.u paramu, String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.H(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.a(paramu, paramString1)));
    return localk;
  }

  public static k a(UserInfo paramUserInfo, String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.v(), com.netease.framework.a.b.b);
    localk.a(new ByteArrayEntity(n.a(paramUserInfo)));
    localk.b("Cache-Control", "no-cache");
    return localk;
  }

  public static k a(d paramd, ac paramac, String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.B(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.a(paramd, paramac, paramString1)));
    return localk;
  }

  public static k a(d paramd, String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.H(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.a(paramd, paramString1)));
    return localk;
  }

  public static k a(String paramString)
  {
    k localk = new k(com.netease.pris.b.a.u());
    localk.b("Accept", "*/*");
    localk.b("Cache-Control", "no-cache");
    localk.a("username", paramString);
    return localk;
  }

  public static k a(String paramString1, ac paramac, String paramString2, String paramString3)
  {
    k localk;
    if (paramac != null)
    {
      localk = new k(paramString1, com.netease.framework.a.b.b);
      localk.b("Content-Type", "application/atom+xml");
      localk.a(new ByteArrayEntity(n.a(paramac)));
    }
    while (true)
    {
      return localk;
      localk = new k(paramString1);
    }
  }

  public static k a(String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.r());
    localk.b("Cache-Control", "no-cache");
    localk.b("PRIS-Session", d);
    localk.a("did", com.netease.pris.a.u.g(com.netease.b.a.d.h().a()));
    return localk;
  }

  // ERROR //
  public static k a(String paramString1, String paramString2, android.graphics.Bitmap paramBitmap, String paramString3)
  {
    // Byte code:
    //   0: new 39	com/netease/framework/a/k
    //   3: dup
    //   4: invokestatic 153	com/netease/pris/b/a:w	()Ljava/lang/String;
    //   7: getstatic 44	com/netease/framework/a/b:b	Lcom/netease/framework/a/b;
    //   10: invokespecial 47	com/netease/framework/a/k:<init>	(Ljava/lang/String;Lcom/netease/framework/a/b;)V
    //   13: astore 4
    //   15: aload_3
    //   16: invokestatic 159	android/graphics/Bitmap$CompressFormat:valueOf	(Ljava/lang/String;)Landroid/graphics/Bitmap$CompressFormat;
    //   19: astore 11
    //   21: aload 11
    //   23: astore 6
    //   25: aload 4
    //   27: ldc 49
    //   29: aload_3
    //   30: invokevirtual 54	com/netease/framework/a/k:b	(Ljava/lang/String;Ljava/lang/String;)V
    //   33: new 161	java/io/ByteArrayOutputStream
    //   36: dup
    //   37: invokespecial 162	java/io/ByteArrayOutputStream:<init>	()V
    //   40: astore 8
    //   42: aload 6
    //   44: ifnonnull +61 -> 105
    //   47: aload_2
    //   48: getstatic 166	android/graphics/Bitmap$CompressFormat:JPEG	Landroid/graphics/Bitmap$CompressFormat;
    //   51: bipush 100
    //   53: aload 8
    //   55: invokevirtual 172	android/graphics/Bitmap:compress	(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z
    //   58: pop
    //   59: aload 4
    //   61: ldc 49
    //   63: ldc 174
    //   65: invokevirtual 54	com/netease/framework/a/k:b	(Ljava/lang/String;Ljava/lang/String;)V
    //   68: aload 4
    //   70: new 56	org/apache/http/entity/ByteArrayEntity
    //   73: dup
    //   74: aload 8
    //   76: invokevirtual 178	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   79: invokespecial 76	org/apache/http/entity/ByteArrayEntity:<init>	([B)V
    //   82: invokevirtual 79	com/netease/framework/a/k:a	(Lorg/apache/http/HttpEntity;)V
    //   85: aload 4
    //   87: areturn
    //   88: astore 5
    //   90: aconst_null
    //   91: astore 6
    //   93: aload 5
    //   95: astore 7
    //   97: aload 7
    //   99: invokevirtual 181	java/lang/Exception:printStackTrace	()V
    //   102: goto -69 -> 33
    //   105: aload_2
    //   106: aload 6
    //   108: bipush 100
    //   110: aload 8
    //   112: invokevirtual 172	android/graphics/Bitmap:compress	(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z
    //   115: pop
    //   116: goto -48 -> 68
    //   119: astore 7
    //   121: goto -24 -> 97
    //
    // Exception table:
    //   from	to	target	type
    //   15	21	88	java/lang/Exception
    //   25	33	119	java/lang/Exception
  }

  public static k a(String paramString1, String paramString2, ac paramac, int paramInt, String paramString3, String paramString4)
  {
    StringBuilder localStringBuilder = new StringBuilder().append("");
    String str;
    k localk;
    if (paramInt >= 1)
    {
      str = paramString1.replace("{startPage?}", paramInt).replace("{searchTerms}", URLEncoder.encode(paramString2));
      if (paramac == null)
        break label96;
      localk = new k(str, com.netease.framework.a.b.b);
      localk.b("Content-Type", "application/atom+xml");
      localk.a(new ByteArrayEntity(n.a(paramac)));
    }
    while (true)
    {
      return localk;
      paramInt = 1;
      break;
      label96: localk = new k(str);
    }
  }

  public static k a(String paramString1, String paramString2, ac paramac, String paramString3, String paramString4)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.b);
    localk.a("id", paramString2);
    localk.a("op", "del");
    localk.a(new ByteArrayEntity(n.b(paramac)));
    return localk;
  }

  public static k a(String paramString1, String paramString2, ac paramac, String paramString3, String paramString4, String paramString5)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.a(paramString2, paramString3, paramString4, paramac)));
    return localk;
  }

  public static k a(String paramString1, String paramString2, s params, String paramString3, String paramString4, String paramString5)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml;type=entry");
    localk.a(new ByteArrayEntity(n.a(paramString2, paramString4, paramString3, params)));
    return localk;
  }

  public static k a(String paramString1, String paramString2, String paramString3)
  {
    return new k(paramString1);
  }

  public static k a(String paramString1, String paramString2, String paramString3, float paramFloat, String paramString4, String paramString5)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml;type=entry");
    localk.a(new ByteArrayEntity(n.a(paramString2, paramString4, paramString3, paramFloat)));
    return localk;
  }

  public static k a(String paramString1, String paramString2, String paramString3, ac paramac, String paramString4, String paramString5, String paramString6)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml;type=entry");
    localk.a(new ByteArrayEntity(n.a(paramString3, paramString5, paramString2, paramString4, paramac)));
    return localk;
  }

  public static k a(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.b);
    localk.a("id", paramString2);
    localk.a("op", "del");
    return localk;
  }

  public static k a(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml;type=entry");
    localk.a(new ByteArrayEntity(n.a(paramString3, paramString4, paramString2)));
    return localk;
  }

  public static k a(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml;type=entry");
    localk.a(new ByteArrayEntity(n.a(paramString2, paramString5, paramString3, paramString4)));
    return localk;
  }

  public static k a(LinkedList paramLinkedList, String paramString1, String paramString2, String paramString3, String paramString4)
  {
    k localk = new k(com.netease.pris.b.a.F(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.a(paramLinkedList, paramString1, paramString2, paramString3)));
    return localk;
  }

  public static k a(List paramList, com.netease.h.a parama, int paramInt1, int paramInt2, int paramInt3)
  {
    k localk = new k(com.netease.pris.b.a.K(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    com.netease.f.h localh = new com.netease.f.h(localByteArrayOutputStream);
    com.netease.f.b localb1 = localh.c("reports", null);
    localb1.a("account", parama.b());
    localb1.a("id", parama.e());
    localb1.a("os", parama.g());
    localb1.a("os_version", parama.h());
    localb1.a("ver", parama.d());
    localb1.a("product", parama.i());
    com.netease.f.b localb2 = localb1.a("offline_report", null);
    localb2.a("net", String.valueOf(paramInt1));
    com.netease.f.b localb3 = localb2.a("sources", null);
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
      localb3.a("source", (String)localIterator.next());
    localb2.a("hide", null).a("times", String.valueOf(paramInt2));
    localb2.a("result", String.valueOf(paramInt3));
    localh.a();
    localk.a(new ByteArrayEntity(localByteArrayOutputStream.toByteArray()));
    return localk;
  }

  public static m a()
  {
    String str = com.netease.pris.b.a.G();
    if (str == null);
    for (k localk = null; ; localk = new k(str))
      return localk;
  }

  public static m a(int paramInt, String paramString1, String paramString2)
  {
    Object localObject = null;
    String str = com.netease.pris.b.a.O();
    if (str == null);
    while (true)
    {
      return localObject;
      k localk = new k(str, com.netease.framework.a.b.b);
      localk.b("Content-Type", "application/atom+xml");
      ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
      com.netease.f.h localh = new com.netease.f.h(localByteArrayOutputStream);
      com.netease.f.b localb = localh.c("errors", null).f("http");
      localb.b("code", String.valueOf(paramInt));
      localb.b("href", paramString1);
      localb.g(paramString2);
      localh.a();
      localk.a(new ByteArrayEntity(localByteArrayOutputStream.toByteArray()));
      localObject = localk;
    }
  }

  public static m a(long paramLong, String paramString1, String paramString2, String paramString3, String paramString4)
  {
    m localm = new m("http://fankui.163.com/ft/commentInner.fb", com.netease.framework.a.b.b);
    localm.b("Content-Type", "application/x-www-form-urlencoded");
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append(e.c(com.netease.b.a.d.h().a()));
    localStringBuilder.append(";");
    localStringBuilder.append("android/" + Build.VERSION.RELEASE);
    localStringBuilder.append(";");
    localStringBuilder.append("PRIS/");
    localStringBuilder.append(e.a(com.netease.b.a.d.h().a()));
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(new BasicNameValuePair("feedbackId", String.valueOf(paramLong)));
    localArrayList.add(new BasicNameValuePair("productId", "11001"));
    localArrayList.add(new BasicNameValuePair("resolution", localStringBuilder.toString()));
    localArrayList.add(new BasicNameValuePair("userName", paramString1));
    if (paramString2 != null)
      localArrayList.add(new BasicNameValuePair("title", paramString2));
    localArrayList.add(new BasicNameValuePair("content", paramString3));
    if (paramString4 != null)
    {
      localArrayList.add(new BasicNameValuePair("fileId", paramString4));
      localArrayList.add(new BasicNameValuePair("fileName", "pris_log.zip"));
    }
    try
    {
      localm.a(new UrlEncodedFormEntity(localArrayList, "GB2312"));
      return localm;
    }
    catch (UnsupportedEncodingException localUnsupportedEncodingException)
    {
      while (true)
        localUnsupportedEncodingException.printStackTrace();
    }
  }

  public static m a(com.netease.h.b paramb, String paramString1, String paramString2)
  {
    m localm = com.netease.h.c.a(paramb, paramString1, null, null, paramString2);
    localm.b("Cache-Control", "no-cache");
    return localm;
  }

  public static k b()
  {
    return new k("http://easyread.163.com/getServiceUrl.atom");
  }

  public static k b(d paramd, ac paramac, String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.C(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.b(paramd, paramac, paramString1)));
    return localk;
  }

  public static k b(d paramd, String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.I(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.b(paramd, paramString1)));
    return localk;
  }

  public static k b(String paramString1, ac paramac, String paramString2, String paramString3)
  {
    k localk;
    if (paramac != null)
    {
      localk = new k(paramString1, com.netease.framework.a.b.b);
      localk.b("Content-Type", "application/atom+xml");
      localk.a(new ByteArrayEntity(n.a(paramac)));
    }
    while (true)
    {
      return localk;
      localk = new k(paramString1);
    }
  }

  public static k b(String paramString1, String paramString2)
  {
    return new k(com.netease.pris.b.a.y());
  }

  public static k b(String paramString1, String paramString2, String paramString3)
  {
    k localk = new k(com.netease.pris.b.a.I(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.a(paramString1, paramString2)));
    return localk;
  }

  public static k b(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    k localk = new k(com.netease.pris.b.a.F(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.c(paramString1, paramString2, paramString3)));
    return localk;
  }

  public static k b(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.c);
    localk.b("Content-Type", "application/atom+xml;type=entry");
    localk.a(new ByteArrayEntity(n.b(paramString2, paramString3, paramString5)));
    localk.a("op", "edit");
    return localk;
  }

  public static m b(String paramString)
  {
    String str = com.netease.pris.b.a.t();
    k localk;
    if ((str == null) || (paramString == null))
      localk = null;
    while (true)
    {
      return localk;
      localk = new k(str);
      localk.a("articleid", paramString);
    }
  }

  public static k c(d paramd, ac paramac, String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.E(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.c(paramd, paramac, paramString1)));
    return localk;
  }

  public static k c(String paramString1, ac paramac, String paramString2, String paramString3)
  {
    k localk = new k(paramString1, com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.b(paramac)));
    return localk;
  }

  public static k c(String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.z());
    String str = com.netease.pris.a.i.c(com.netease.b.a.d.h().a());
    if (!TextUtils.isEmpty(str))
      localk.a("mid", str);
    return localk;
  }

  public static k c(String paramString1, String paramString2, String paramString3)
  {
    k localk = new k(paramString1);
    localk.b("Content-Type", "application/atom+xml");
    return localk;
  }

  public static m c()
  {
    k localk = new k("http://fankui.163.com/ft/file.fb?op=up", com.netease.framework.a.b.b);
    File localFile;
    if (com.netease.g.b.c("pris_log.zip"))
    {
      localFile = com.netease.g.b.b("pris_log.zip");
      com.netease.g.b.c("createPostLogReqeust upload=", localFile.toString());
    }
    try
    {
      while (true)
      {
        localb = new com.netease.a.b.b("Filedata", "pris_log.zip", localFile, "application/zip", null);
        com.netease.a.b.a[] arrayOfa = new com.netease.a.b.a[1];
        arrayOfa[0] = localb;
        localk.a(new com.netease.a.b.h(arrayOfa));
        return localk;
        com.netease.g.b.c("createPostLogReqeust()", "zip fail");
        localFile = null;
      }
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      while (true)
      {
        localFileNotFoundException.printStackTrace();
        com.netease.a.b.b localb = null;
      }
    }
  }

  public static m c(d paramd, String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.L(), com.netease.framework.a.b.b);
    localk.b("Content-Type", "application/atom+xml");
    localk.a(new ByteArrayEntity(n.a(paramd, paramString1, paramString2)));
    return localk;
  }

  public static m c(String paramString)
  {
    String str = com.netease.pris.b.a.t();
    k localk;
    if ((str == null) || (paramString == null))
      localk = null;
    while (true)
    {
      return localk;
      localk = new k(str);
      localk.a("url", paramString);
    }
  }

  public static k d(String paramString)
  {
    return new k(paramString);
  }

  public static k d(String paramString1, String paramString2)
  {
    return new k(com.netease.pris.b.a.J());
  }

  public static k d(String paramString1, String paramString2, String paramString3)
  {
    return new k(paramString1);
  }

  public static k e(String paramString1, String paramString2)
  {
    k localk = new k(com.netease.pris.b.a.D());
    localk.b("Cache-Control", "no-cache");
    return localk;
  }

  public static k e(String paramString1, String paramString2, String paramString3)
  {
    k localk = new k(paramString1);
    localk.b("Content-Type", "application/atom+xml");
    return localk;
  }

  public static k f(String paramString1, String paramString2)
  {
    return new k(com.netease.pris.b.a.s());
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.protocol.c
 * JD-Core Version:    0.6.0
 */